<section class="wrapper">
  <!-- page start-->
  <div class="row">
      <div class="col-lg-12">
        <section class="panel">
          <header class="panel-heading">
            修 改
          </header>
          <div class="panel-body">
            <form class="form-horizontal adminex-form" >
              <input type="text" class="show_content" hidden value="<%= @introduce.content %>">
              <div class="form-group">
                <label class="col-sm-2 col-sm-2 control-label"><i class="bi_tian">*&nbsp</i>内容</label>
                <div id="editor" class="col-sm-10">
                  <div>
                  </div>
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-2 col-sm-2 control-label"></label>
                <div class="col-sm-10">
                  <button type="button" class="btn btn-primary" id="submit_data" data-url="/admin/introduces/<%= @introduce.id %>">提交</button>
                </div>
              </div>
            </form>
          </div>
        </section>
      </div>
    </div>
</section>
<% content_for :js do %>
  <!-- 注意， 只需要引用 JS，无需引用任何 CSS ！！！-->
  <script type="text/javascript" src="/js/wangEditor.min.js"></script>
  <script type="text/javascript" charset="utf-8">
      var E = window.wangEditor;
      var editor = new E('#editor');
      editor.customConfig.uploadImgServer = '/admin/articles/upload';
      editor.create();
      $('#submit_data').click(function () {
          var _this = $(this);
          var url = _this.attr('data-url');
          var data = {};
          data['content'] = editor.txt.html();
          doRequest(_this,url,'PUT',data);
      });
      window.onload = function () {
          var content = $('.show_content').val();
          editor.txt.html(content);
      }
  </script>
<% end %>